// classification.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    data:[
      {
        url:'http://img4.imgtn.bdimg.com/it/u=625203718,3743444032&fm=26&gp=0.jpg',
        title:'红葡萄酒'
      },
      {
        url: 'http://img4.imgtn.bdimg.com/it/u=625203718,3743444032&fm=26&gp=0.jpg',
        title: '洋酒'
      },
      {
        url: 'http://img3.imgtn.bdimg.com/it/u=2156706719,3660398174&fm=26&gp=0.jpg',
        title: '白葡萄酒'
      },
      {
        url: 'http://img3.imgtn.bdimg.com/it/u=336448281,1508349330&fm=26&gp=0.jpg',
        title: '桃红葡萄酒'
      },
      {
        url: 'http://img1.imgtn.bdimg.com/it/u=3670287074,3722541963&fm=26&gp=0.jpg',
        title: '起泡酒'
      }
    ]
  },
  onLoad(){
    wx.showLoading({
      title: '正在加载...',
    })
    let baseUrl = getApp().globalData.baseUrl,
        access_token = getApp().globalData.access_token,
        self = this
        wx.request({
          url: baseUrl + '/Category/index',
          data: { access_token },
          method: 'get',
          success: data => {
            // console.log(data.data)
            if(data.data.code == 200){
              self.setData({
                data: data.data.data
              })
              wx.hideLoading()
            }
          }
        })
  },
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh()
  },
})